home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / superopt.5 / superopt / superopt-2.5 / Makefile < prev    next >
Encoding:
Makefile  |  1995-05-23  |  4.1 KB  |  142 lines

  1. # Makefile for GNU superoptimizer
  2.  
  3. MAXCOST = 3
  4. EXTRA = -shifts -extracts
  5.  
  6. CC = gcc
  7. DBG = -g
  8. OPT = -O
  9. CFLAGS = $(CPU) $(OPT) $(DBG)
  10. ALL_MACHINES =    superopt-sparc \
  11.         superopt-power \
  12.         superopt-powerpc \
  13.         superopt-m88000 \
  14.         superopt-am29k \
  15.         superopt-mc68000 \
  16.         superopt-mc68020 \
  17.         superopt-i386 \
  18.         superopt-i960a \
  19.         superopt-i960b \
  20.         superopt-pyr \
  21.         superopt-alpha \
  22.         superopt-sh \
  23.         superopt-hppa
  24.  
  25. OBJS    = superopt.o
  26. SRCS    = superopt.c
  27. HDRS    = run_program.def insn.def goal.def superopt.h version.h longlong.h
  28. BINDIR    = /usr/local/bin
  29. INSTALL    = install -c
  30. FILES    = README COPYING Makefile TODO ChangeLog superopt.c synth.def $(HDRS)
  31.  
  32. VERSION = `sed 's,char \*version_string = "\([0-9.]*\)";,\1,' < version.h`
  33.  
  34. superopt: $(SRCS) $(HDRS)
  35.     $(CC) $(CFLAGS) -o superopt $(SRCS)
  36.  
  37. clean:
  38.     rm -f $(OBJS) superopt $(ALL_MACHINES) *.tmp
  39.  
  40. install: superopt
  41.     $(INSTALL) superopt $(BINDIR)/superopt
  42.  
  43. all: $(ALL_MACHINES)
  44.  
  45. install-all: all
  46.     for x in $(ALL_MACHINES); do $(INSTALL) $$x $(BINDIR)/$$x; done
  47.  
  48. run-all: sparc.res power.res powerpc.res m88000.res am29k.res mc68000.res \
  49.     mc68020.res i386.res i960a.res i960b.res pyr.res alpha.res sh.res \
  50.     hppa.res
  51.     @echo "Done!"
  52.  
  53. superopt-sparc: $(SRCS) $(HDRS)
  54.     $(CC) $(CFLAGS) -DSPARC -o superopt-sparc $(SRCS)
  55. sparc.res: superopt-sparc
  56.     ./superopt-sparc -all $(EXTRA) -max $(MAXCOST) -as >sparc.tmp 2>&1
  57.     mv sparc.tmp sparc.res
  58.  
  59. superopt-power: $(SRCS) $(HDRS)
  60.     $(CC) $(CFLAGS) -DPOWER -o superopt-power $(SRCS)
  61. power.res: superopt-power
  62.     ./superopt-power -all $(EXTRA) -max $(MAXCOST) -as >power.tmp 2>&1
  63.     mv power.tmp power.res
  64.  
  65. superopt-powerpc: $(SRCS) $(HDRS)
  66.     $(CC) $(CFLAGS) -DPOWERPC -o superopt-powerpc $(SRCS)
  67. powerpc.res: superopt-powerpc
  68.     ./superopt-powerpc -all $(EXTRA) -max $(MAXCOST) -as >powerpc.tmp 2>&1
  69.     mv powerpc.tmp powerpc.res
  70.  
  71. superopt-m88000: $(SRCS) $(HDRS)
  72.     $(CC) $(CFLAGS) -DM88000 -o superopt-m88000 $(SRCS)
  73. m88000.res: superopt-m88000
  74.     ./superopt-m88000 -all $(EXTRA) -max $(MAXCOST) -as >m88000.tmp 2>&1
  75.     mv m88000.tmp m88000.res
  76.  
  77. superopt-am29k: $(SRCS) $(HDRS)
  78.     $(CC) $(CFLAGS) -DAM29K -o superopt-am29k $(SRCS)
  79. am29k.res: superopt-am29k
  80.     ./superopt-am29k -all $(EXTRA) -max $(MAXCOST) -as >am29k.tmp 2>&1
  81.     mv am29k.tmp am29k.res
  82.  
  83. superopt-mc68000: $(SRCS) $(HDRS)
  84.     $(CC) $(CFLAGS) -DMC68000 -o superopt-mc68000 $(SRCS)
  85. mc68000.res: superopt-mc68000
  86.     ./superopt-mc68000 -all $(EXTRA) -max $(MAXCOST) -as >mc68000.tmp 2>&1
  87.     mv mc68000.tmp mc68000.res
  88.  
  89. superopt-mc68020: $(SRCS) $(HDRS)
  90.     $(CC) $(CFLAGS) -DMC68020 -o superopt-mc68020 $(SRCS)
  91. mc68020.res: superopt-mc68020
  92.     ./superopt-mc68020 -all $(EXTRA) -max $(MAXCOST) -as >mc68020.tmp 2>&1
  93.     mv mc68020.tmp mc68020.res
  94.  
  95. superopt-i386: $(SRCS) $(HDRS)
  96.     $(CC) $(CFLAGS) -DI386 -o superopt-i386 $(SRCS)
  97. i386.res: superopt-i386
  98.     ./superopt-i386 -all $(EXTRA) -max $(MAXCOST) -as >i386.tmp 2>&1
  99.     mv i386.tmp i386.res
  100.  
  101. superopt-i960a: $(SRCS) $(HDRS)
  102.     $(CC) $(CFLAGS) -DI960 -o superopt-i960a $(SRCS)
  103. i960a.res: superopt-i960a
  104.     ./superopt-i960a -all $(EXTRA) -max $(MAXCOST) -as >i960a.tmp 2>&1
  105.     mv i960a.tmp i960a.res
  106.  
  107. superopt-i960b: $(SRCS) $(HDRS)
  108.     $(CC) $(CFLAGS) -DI960B -o superopt-i960b $(SRCS)
  109. i960b.res: superopt-i960b
  110.     ./superopt-i960b -all $(EXTRA) -max $(MAXCOST) -as >i960b.tmp 2>&1
  111.     mv i960b.tmp i960b.res
  112.  
  113. superopt-pyr: $(SRCS) $(HDRS)
  114.     $(CC) $(CFLAGS) -DPYR -o superopt-pyr $(SRCS)
  115. pyr.res: superopt-pyr
  116.     ./superopt-pyr -all $(EXTRA) -max $(MAXCOST) -as >pyr.tmp 2>&1
  117.     mv pyr.tmp pyr.res
  118.  
  119. superopt-alpha: $(SRCS) $(HDRS)
  120.     $(CC) $(CFLAGS) -DALPHA -o superopt-alpha $(SRCS)
  121. alpha.res: superopt-alpha
  122.     ./superopt-alpha -all $(EXTRA) -max $(MAXCOST) -as >alpha.tmp 2>&1
  123.     mv alpha.tmp alpha.res
  124.  
  125. superopt-sh: $(SRCS) $(HDRS)
  126.     $(CC) $(CFLAGS) -DSH -o superopt-sh $(SRCS)
  127. sh.res: superopt-sh
  128.     ./superopt-sh -all $(EXTRA) -max $(MAXCOST) -as >sh.tmp 2>&1
  129.     mv sh.tmp sh.res
  130.  
  131. superopt-hppa: $(SRCS) $(HDRS)
  132.     $(CC) $(CFLAGS) -DHPPA -o superopt-hppa $(SRCS)
  133. hppa.res: superopt-hppa
  134.     ./superopt-hppa -all $(EXTRA) -max $(MAXCOST) -as >hppa.tmp 2>&1
  135.     mv hppa.tmp hppa.res
  136.  
  137. dist:
  138.     mkdir superopt-$(VERSION)
  139.     ln $(FILES) superopt-$(VERSION)
  140.     tar cf - superopt-$(VERSION) | gzip --best > superopt-$(VERSION).tar.gz
  141.     rm -rf superopt-$(VERSION)
  142.